package com.ruoyi.hr.common.constant;

import java.util.HashMap;
import java.util.Map;

public class StatusConst {
	public static class Check {
		/**
		 * 简历检查状态
		 */
		public enum CheckStatus {
			NOCHECK("未审核",0 ),
			PASS("审核通过",1),
			UNPASS("已驳回",2);
			private static final Map<Integer, CheckStatus> codeToStatusMap = new HashMap<>();
			static {
				for (CheckStatus status : CheckStatus.values()) {
					codeToStatusMap.put(status.code, status);
				}
			}
			public static String getMsgByCode(int code) {
				CheckStatus status = codeToStatusMap.get(code);
				return status != null ? status.msg : null; // 或者返回一个默认值，如"未知状态"
			}
			private String msg;
			private int code;

			CheckStatus(String msg, int code) {
				this.msg = msg;
				this.code = code;
			}

			public String getMsg() {
				return msg;
			}

			public int getCode() {
				return code;
			}
		}
		/**
		 * 审核类型
		 */
		public enum TypeStatus {
			Resume("简历审核",1),
			HIRE("录用审核",2);
			private String msg;
			private int code;

			private static final Map<Integer, TypeStatus> codeToStatusMap = new HashMap<>();
			static {
				for (TypeStatus status : TypeStatus.values()) {
					codeToStatusMap.put(status.code, status);
				}
			}
			public static String getMsgByCode(int code) {
				TypeStatus status = codeToStatusMap.get(code);
				return status != null ? status.msg : null; // 或者返回一个默认值，如"未知状态"
			}
			TypeStatus(String msg, int code) {
				this.msg = msg;
				this.code = code;
			}

			public String getMsg() {
				return msg;
			}

			public int getCode() {
				return code;
			}
		}
	}

	public static class Resume {
		/**
		 * 简历本身状态
		 */
		public enum ResumeStatus{
			RESUME_CHECK("简历待审核",1),
			INTERVIEW("待面试",2),
			HIRE_CHECK("录用待审核",3),
			HIRE_OK("已录用",4),
			INDUCTION("已入职",5);
			private static final Map<Integer, ResumeStatus> codeToStatusMap = new HashMap<>();
			static {
				for (ResumeStatus status : ResumeStatus.values()) {
					codeToStatusMap.put(status.code, status);
				}
			}
			public static String getMsgByCode(int code) {
				ResumeStatus status = codeToStatusMap.get(code);
				return status != null ? status.msg : null; // 或者返回一个默认值，如"未知状态"
			}
			private String msg;
			private int code;

			ResumeStatus(String msg, int code) {
				this.msg = msg;
				this.code = code;
			}

			public String getMsg() {
				return msg;
			}

			public int getCode() {
				return code;
			}

		}

		/**
		 * 简历位置状态
		 */
		public enum PositionStatus{
			COMMON("不在三库中",0),
			TALENT("人才库", 1),
			FAILURE("无效库",2),
			BLACK("黑名单",3);

			private static final Map<Integer, PositionStatus> codeToStatusMap = new HashMap<>();
			static {
				for (PositionStatus status : PositionStatus.values()) {
					codeToStatusMap.put(status.code, status);
				}
			}
			public static String getMsgByCode(int code) {
				PositionStatus status = codeToStatusMap.get(code);
				return status != null ? status.msg : null; // 或者返回一个默认值，如"未知状态"
			}
			private String msg;
			private int code;

			PositionStatus(String msg, int code) {
				this.msg = msg;
				this.code = code;
			}

			public String getMsg() {
				return msg;
			}

			public int getCode() {
				return code;
			}

		}

		public enum BGStatus {
			NO_BG("未背调", 0),
			BG_DOING("背调中", 1),
			BG_PASS("背调通过", 2),
			BG_UNPASS("背调不通过", 3);

			// TODO 加一个map 表示 code 和 msg 的映射, 后面直接按照这个获取就行了
			private static final Map<Integer, BGStatus> codeToStatusMap = new HashMap<>();

			private String msg;
			private int code;

			static {
				for (BGStatus status : BGStatus.values()) {
					codeToStatusMap.put(status.code, status);
				}
			}

			BGStatus(String msg, int code) {
				this.msg = msg;
				this.code = code;
			}

			public String getMsg() {
				return msg;
			}

			public int getCode() {
				return code;
			}

			public static String getMsgByCode(int code) {
				BGStatus status = codeToStatusMap.get(code);
				return status != null ? status.msg : null; // 或者返回一个默认值，如"未知状态"
			}
		}
	}
}
